<layout name="mun" />
<div class="operation_user clearfix">
    <div class="link fl"><a href="#">商城</a><span>&gt;&gt;</span><a href="#">商品管理</a><span>&gt;&gt;</span>管理员管理</div>
    <div class="link fr">
        <a href="#" class="icon icon_i">首页</a><span></span>欢迎您！<span>Admin</span><a href="#" class="icon icon_e">退出</a>
    </div>
</div>
<div class="content clearfix">
    <div class="main">
        <!--右侧内容-->
        <div class="cont">
            <div class="title">商品管理</div>
            <div class="details">
                <div class="details_operation clearfix">
                    <div class="bui_select">
                        <a href="{:U('Addmodity/index')}" class="btn btn-primary">添&nbsp;&nbsp;加</a>
                    </div>
                    <div class="fr">
                        <form class="form-inline">
                            <div class="form-group">
                                <label for="userName">用户名</label>
                                <input type="text" class="form-control" id="userName" placeholder="用户名">
                            </div>
                            <button type="submit" class="btn btn-primary">搜索</button>
                        </form>
                    </div>
                </div>
                <!--表格-->
                <table class="table table-striped">
                    <thead>
                    <tr>
                        <th>编号</th>
                        <th>商品名称</th>
                        <th>所属分类</th>
                        <th>商品货号</th>
                        <th>商品库存</th>
                        <th>市场价</th>
                        <th>网站价</th>
                        <th>商品简介</th>
                        <th>商品图片</th>
                        <th>商品上架时间</th>
                        <th>商品是否上架</th>
                        <th>商品是否热卖</th>
                        <th>操作</th>
                    </tr>
                    </thead>
                    <tbody>
                    <volist name="Rs" id="vo">
                        <tr>
                            <td><input type="checkbox" id="c1" class="check"><label for="c1" class="label">{$vo.id}</label></td>
                            <td>{$vo.pname}</td>
                            <td>{$vo.cname}</td>
                            <td>{$vo.psn}</td>
                            <td>库存{$vo.pnum}件</td>
                            <td>{$vo.mprice}元</td>
                            <td>{$vo.iprice}元</td>
                            <td>{$vo.pdesc}</td>
                            
                            <td><a href="{:U('Lommodity/Img?id='.$vo[\"id\"])}">查看图片</a></td>
                            <td>{$vo.pubtime}</td>
                            <td>
                            <if condition="$vo['isshow'] eq 1 ">
                            是
                             
                             <else /> 
                            否
                              </if>
                          
                            </td>
                            <td>
                            
                            <if condition="$vo['ishot'] eq 1 ">
                            是
           
                             <else /> 
                             否
                            </if>
                            </td>
                            <td><a href="{:U('Lommodity/xiugai?id='.$vo[\"id\"])}" class="btn btn-primary">修改</a>
                                <button name="Dell" value="{$vo.id}" class="btn btn-danger col-sm-offset-1">删除</button></td>
                    </tr>

                    </volist>


                    </tbody>
                </table>
                <div class="fr">
                    <nav>
                        <ul class="pagination">
									{$page}
                        </ul>
                    </nav>
                </div>
            </div>
        </div>
    </div>
    <SCRIPT src="__JS__jquery-1.9.1.min.js" type="text/javascript"></SCRIPT>
    <script type="text/javascript">
        $(function(){
            $("button[name=Dell]").click(function(){
                $.post("{:U('Lommodity/Dell')}",{
                    id:$(this).val()
                },function(data){
                    if(data.status == 0){
                        alert(data.info);
                    }else{
                        alert(data.info);
                        location.href=data.url;
                    }
                });
            });
        });
    </script>